package edu.ubb.scp.model;

import java.lang.reflect.Field;

public class Provider implements Model {
	private int ProviderID;
	private String ProviderName;
	private String ProviderAddress;
	
	public Provider(String providerName, String providerAddress,
			String providerTel) {
		super();
		ProviderName = providerName;
		ProviderAddress = providerAddress;
		ProviderTel = providerTel;
	}

	public Provider() {
	}

	private String ProviderTel;
	
	public int getProviderID() {
		return ProviderID;
	}
	public void setProviderID(int providerID) {
		ProviderID = providerID;
	}
	public String getProviderName() {
		return ProviderName;
	}
	public void setProviderName(String providerName) {
		ProviderName = providerName;
	}
	public String getProviderAddress() {
		return ProviderAddress;
	}
	public void setProviderAddress(String providerAddress) {
		ProviderAddress = providerAddress;
	}
	public String getProviderTel() {
		return ProviderTel;
	}
	public void setProviderTel(String providerTel) {
		ProviderTel = providerTel;
	}
	
	@Override
	public String toString() {
		return "Provider [ProviderID=" + ProviderID + ", ProviderName="
				+ ProviderName + ", ProviderAddress=" + ProviderAddress
				+ ", ProviderTel=" + ProviderTel + "]";
	}
	
	@Override
	public Field getPrimaryKey() {
		try {
			return Provider.class.getDeclaredField("ProviderID");
		} catch (NoSuchFieldException e) {
			e.printStackTrace();
		} catch (SecurityException e) {
			e.printStackTrace();
		}
		return null;
	}
	
	@Override
	public Field[] getKeys() {
		return new Field[] { getPrimaryKey() };
	}
}
